<template>
  <div class="publishHomework">
    <div class="left">
      <Menu :chapterData="chapterData" :homeworkData="homeworkData"></Menu>
    </div>
    <div class="right">
      <router-view></router-view>
      <!-- <CreatHomeWork></CreatHomeWork> -->
    </div>
  </div>
</template>

<script>
import Menu from '../components/publishHomework/menuForPulishHomework.vue'
import CreatHomeWork from '../components/publishHomework/creatHomeWork.vue'
export default {
  name: 'publishHomework',
  components: {
    Menu,
    CreatHomeWork,
  },
  mounted() {
    this.axios.defaults.headers.common[
      'Authorization'
    ] = window.sessionStorage.getItem('token')
    this.axios.post('/course/query_all/').then(res => {
      this.chapterData = res
    })
    this.axios.post('/assess/query_work_list/').then(res => {
      this.homeworkData = res
    })
  },
  data() {
    return {
      chapterData: [],
      homeworkData: [],
    }
  },
}
</script>

<style lang="scss" scoped>
.publishHomework {
  margin-top: 20px;
  width: 100%;
  display: flex;
  justify-content: start;
  .left {
    background-color: #fff;
    height: calc(100vh - 85px);
  }
  .right {
    flex: 1;
  }
}
</style>
